<template>
	<view class="content">
		<u-navbar @leftClick="back" :title="name"   leftIconColor="#FC2530">
			
		</u-navbar>
		<view style="margin-top: 53px;">
			<view class="box">
				<view class="box_item" v-for="(item,index) in list" :key=index>
					<u-image :src="item.photoUrl |photoPrefix" radius="10px" width="280rpx" height="180rpx" :fade="true" duration="450">
					</u-image>
					<!-- <view class="box_text">{{item.text}}</view> -->
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				bgColor: '#009fe9', //导航栏背景颜色
				scenicId: '',
				name:'',
				img: 'https://img1.baidu.com/it/u=413643897,2296924942&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500',
				list: []
			}

		},
		onLoad(option) {
			this.scenicId = option.scenicId
			this.name = option.name
			console.log(option);
		},
		mounted() {
			this.getData(this.scenicId)
		},
		methods: {
			getData(id) {
				this.$api({
					url: '/customer/getScenicPhotoById/'+id,
					methods: 'get',
				}).then((res) => {
					this.list = res.data
				})
			},
			rightClick() {
				console.log('rightClick');
			},
			back() {
				uni.navigateBack({
					delta: 2
				})
			}
		}
	}
</script>

<style lang="scss">
	.content {
		background: #efefef;

		.box {
			width: 100%;
			background: #fff;
			display: flex;
			flex-direction: row;
			flex-wrap: wrap;
			justify-content: space-evenly;
			margin-bottom: 10px;

			&_item {
				width: 40%;
				margin-top: 20rpx;
			}

			&_text {
				margin-top: 8rpx;
				color: black;
				font-size: 20rpx;
			}

			&_text2 {
				width: 260rpx;
				color: #cccccc;
				margin-top: 4rpx;
				font-size: 18rpx;
			}
		}
	}
</style>
